<?php
require 'config/config.php';
$a_mimetype = array('css' =>'text/css',
	'js' => 'text/js',
	'pdf' => 'application/pdf',
	'png' => 'image/png',
	'jpg' => 'image/jpg',
	'gif' => 'image/gif'
);
ABConf::load();
$s_file =  PATH_ABS.substr($_SERVER['REQUEST_URI'], strlen(ABConf::get('path')));
if(is_file($s_file)){
	$s_mimetype =  $a_mimetype[pathinfo($s_file, PATHINFO_EXTENSION)];
	$s_size = filesize($s_file);
	header("Content-type: $s_mimetype");
	header("Content-length: $s_size");
	readfile($s_file);
}else{
	header('HTTP/1.0 404 Not Found');
	echo '<h1>Not Found</h1>';
}
?>
